#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QString>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    QString str_r = ui->lineEdit_R->text();
    QString str_g = ui->lineEdit_G->text();
    QString str_b = ui->lineEdit_B->text();
    QString qss =
            QString("QMainWindow{background-color: rgb(%1, %2, %3);}")
                .arg(str_r).arg(str_g).arg(str_b);
    this->setStyleSheet(qss);
}

